home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Broadcaster / BroadcastLoop.h < prev    next >
Text File  |  2000-06-23  |  989b  |  41 lines

  1. // BroadcastLoop.h
  2.  
  3. #ifndef BroadcastLoop_h
  4. #define BroadcastLoop_h
  5.  
  6. #ifndef ListLoop_h
  7. #include "ListLoop.h"
  8. #endif
  9. #ifndef Broadcaster_h
  10. #include "Broadcaster.h"
  11. #endif
  12.  
  13. template < class Protocol >
  14. class BroadcastLoop: private ListLoop< Protocol >
  15.   {
  16.     private:
  17.         typedef ListLoop< Protocol > Inherited;
  18.     
  19.     public:
  20.         BroadcastLoop( const Broadcaster<Protocol>& source )
  21.           : ListLoop< Protocol >( source.receivers )
  22.           {}
  23.         
  24.         void operator++()                { this->Inherited::operator++(); }
  25.         void operator++(int)            { this->Inherited::operator++(); }
  26.         
  27.         // Access declarations are broken in templates in CW Pro 5
  28.         //Inherited::Finished;
  29.         //Inherited::Unfinished;
  30.         //Inherited::operator*;
  31.         //Inherited::operator->;
  32.         
  33.         bool Finished() const            { return Inherited::Finished(); }
  34.         bool Unfinished() const            { return Inherited::Unfinished(); }
  35.  
  36.         Protocol& operator*() const    { return Inherited::operator*(); }
  37.         Protocol *operator->() const    { return Inherited::operator->(); }
  38.   };
  39.  
  40. #endif
  41.